#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<cmath>
#include "calculator.h"

using namespace std;

int main()
{
    for(int i=0;i<9;i++)
    {
        string infix;
        getline(cin,infix);
        cout<< "Input"<<i<<": "<<infix<<endl;
        cout<<"Output"<<i<<": "<< endl;
        bool flag;
        string postfix;
        postfix.assign(infix);
        double result=-1;
        flag = IsStringGood(infix);
        if(flag)
        {
            String_MiddletoPost(infix,postfix);
            cout<<"  后缀表达式为 "<<postfix<<endl;
            result =Calculator_by_Post(postfix);
            cout<<"  计算结果为 "<<result<<endl;
        }
        cout << ' '<<endl;
    
    }
    
    
	
	
 


    return 0;

}